import request from '@/request/request.js'

const PREFIX = '/admin/classify'

/**
 * 获取分类列表
 * @returns {*}
 */
export const getClassifyList = (searchData) => request(`${PREFIX}`, searchData, 'get')

/**
 * 添加分类
 * @param data 表单数据
 * @returns {*}
 */
export const addClassify = (data) => request(`${PREFIX}`, data, 'post')

/**
 * 获取分类
 * @returns {*}
 * @param id
 */
export const getClassifyById = (id) => request(`${PREFIX}/${id}`)

/**
 * 修改分类
 * @param data 表单数据
 * @returns {*}
 */
export const updateClassify = (data) => request(`${PREFIX}`, data, 'put')

/**
 * 删除分类
 * @returns {*}
 * @param id
 */
export const deleteClassify = (id) => request(`${PREFIX}/${id}`, null, 'delete')
